# Test programs

enable_testing()

# Basic tests
add_executable(test_basic
    test_basic.c
)

target_include_directories(test_basic PRIVATE
    ${CMAKE_CURRENT_SOURCE_DIR}/../include
)

target_link_libraries(test_basic
    sdfx_sdk
    ${COMMON_LIBS}
)

add_test(NAME test_basic COMMAND test_basic)

# Random number tests
add_executable(test_random
    test_random.c
)

target_include_directories(test_random PRIVATE
    ${CMAKE_CURRENT_SOURCE_DIR}/../include
)

target_link_libraries(test_random
    sdfx_sdk
    ${COMMON_LIBS}
)

add_test(NAME test_random COMMAND test_random)

# Hash tests
add_executable(test_hash
    test_hash.c
)

target_include_directories(test_hash PRIVATE
    ${CMAKE_CURRENT_SOURCE_DIR}/../include
)

target_link_libraries(test_hash
    sdfx_sdk
    ${COMMON_LIBS}
)

add_test(NAME test_hash COMMAND test_hash)

# Symmetric encryption tests
add_executable(test_symmetric
    test_symmetric.c
)

target_include_directories(test_symmetric PRIVATE
    ${CMAKE_CURRENT_SOURCE_DIR}/../include
)

target_link_libraries(test_symmetric
    sdfx_sdk
    ${COMMON_LIBS}
)

add_test(NAME test_symmetric COMMAND test_symmetric)

# SM2 tests
add_executable(test_sm2
    test_sm2.c
)

target_include_directories(test_sm2 PRIVATE
    ${CMAKE_CURRENT_SOURCE_DIR}/../include
)

target_link_libraries(test_sm2
    sdfx_sdk
    ${COMMON_LIBS}
)

add_test(NAME test_sm2 COMMAND test_sm2)